
export default {
  computed: {
    // 表格中列字段
    columns() {
      return [
        {
          key: 'sf_code',
          title: {
            'zh-CN': '告警编码',
            'en-US': 'sf_code'
          }[this.G_Locale],
          minWidth: 200,
          align: 'center',
          show: true,
          render: (h, params) => {
            return h('Tag', { attrs: { color: this.getCellBg(params.row.alarmColor)},style:{height:'auto'} }, params.row.sf_code)
          }
        },
        {
          key: 'sf_pointValue',
          title: {
            'zh-CN': '告警采集值',
            'en-US': 'sf_pointValue'
          }[this.G_Locale],
          minWidth: 200,
          align: 'center',
          show: true
        },
        {
          key: 'sf_type',
          title: {
            'zh-CN': '告警类型',
            'en-US': 'sf_type'
          }[this.G_Locale],
          minWidth: 200,
          align: 'center',
          show: true
        },
        {
          key: 'sf_energyName',
          title: {
            'zh-CN': '能源名称',
            'en-US': 'sf_energyName'
          }[this.G_Locale],
          minWidth: 100,
          align: 'center',
          show: true
        },
        {
          key: 'sf_energyType',
          title: {
            'zh-CN': '能源类别',
            'en-US': 'sf_energyType'
          }[this.G_Locale],
          minWidth: 200,
          align: 'center',
          show: true
        },
        {
          key: 'tf_warnTime',
          title: {
            'zh-CN': '点位',
            'en-US': 'tf_warnTime'
          }[this.G_Locale],
          minWidth: 200,
          align: 'center',
          show: true,
        },
        {
          key: 'tf_warnTime',
          title: {
            'zh-CN': '告警时间',
            'en-US': 'tf_warnTime'
          }[this.G_Locale],
          minWidth: 200,
          align: 'center',
          show: true,
        },
        {
         key: 'content',
         title: {
           'zh-CN': '告警内容',
           'en-US': 'content'
         }[this.G_Locale],
         minWidth: 200,
         align: 'center',
         show: true,
       },
        {
          key: 'sf_status',
          title: {
            'zh-CN': '状态',
            'en-US': 'sf_status'
          }[this.G_Locale],
          minWidth: 100,
          align: 'center',
          show: true,
          render: (h, params) => {
            return h('div', {}, this.getOptionValue(this.statusOptions, params.row.sf_status))
          },
          config: { type: 'select', options: this.statusOptions, disabled:true }
        },
        {
          key: 'createdBy',
          title: {
            'zh-CN': '创建人账号',
            'en-US': 'created by'
          }[this.G_Locale],
          minWidth: 200,
          align: 'center',
          show: true
        },
        {
          key: 'createTime',
          title: {
            'zh-CN': '创建时间',
            'en-US': 'create time'
          }[this.G_Locale],
          minWidth: 200,
          align: 'center',
          show: true
        },
        {
          key: 'updatedBy',
          title: {
            'zh-CN': '修改人账号',
            'en-US': 'updated by'
          }[this.G_Locale],
          minWidth: 200,
          align: 'center',
          show: true
        },
        {
          key: 'updateTime',
          title: {
            'zh-CN': '修改时间',
            'en-US': 'update time'
          }[this.G_Locale],
          minWidth: 200,
          align: 'center',
          show: true
        }
      ];
    },
    // form中列字段
    formColumns() {
      return [
        {
          key: 'sf_code',
          title: {
            'zh-CN': '告警编码',
            'en-US': 'sf_code'
          }[this.G_Locale],
          minWidth: 100,
          align: 'center',
          config: { type: 'text' }
        },
        {
         key: 'sf_type',
         title: {
           'zh-CN': '告警类型',
           'en-US': 'sf_type'
         }[this.G_Locale],
          minWidth: 100,
          align: 'center',
          config: { type: 'text' }
        },
      ];
    },
    //修改状态字段
    editColumns(){
      return [
        {
          key: 'sf_status',
          title: {
            'zh-CN': '告警状态',
            'en-US': 'sf_status'
          }[this.G_Locale],
          minWidth: 100,
          align: 'center',
          config: { type: 'select', options: this.statusOptions }
        },
      ];
    },
    queryFormItem() {
      return [
        {
          key: 'sf_code',
          title: {
            'zh-CN': '告警编码',
            'en-US': 'sf_code'
          }[this.G_Locale],
          config: {
            type: 'text'
          }
        },
        {
          key: 'sf_type',
          title: {
            'zh-CN': '告警类型',
            'en-US': 'sf_type'
          }[this.G_Locale],
          minWidth: 200,
          align: 'center',
          config: {
            type: 'text'
          }
        },
        {
          key: 'sf_energyName',
          title: {
            'zh-CN': '能源名称',
            'en-US': 'sf_energyName'
          }[this.G_Locale],
          config: {
            type: 'text'
          }
        }
      ];
    },
    collapseFormItem() {
      return [
        {
          key: 'sf_code',
          title: {
            'zh-CN': '告警编码',
            'en-US': 'sf_code'
          }[this.G_Locale],
          config: {
            type: 'text'
          }
        },
        {
          key: 'sf_type',
          title: {
            'zh-CN': '告警类型',
            'en-US': 'sf_type'
          }[this.G_Locale],
          minWidth: 200,
          align: 'center',
          config: {
            type: 'text'
          }
        },
        {
          key: 'sf_energyName',
          title: {
            'zh-CN': '能源名称',
            'en-US': 'sf_energyName'
          }[this.G_Locale],
          config: {
            type: 'text'
          }
        }
      ];
    },
    lang() {
      return {
        'en-US': {
          cancel: 'cancel',
          confirmDelete: 'confirm delete?'
        },
        'zh-CN': {
          cancel: '取消',
          confirmDelete: '确认删除？'
        }
      }[this.G_Locale]
    }
  },
}
